<template>
  <div class="divBox order">
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <div class="container">
          <el-form size="small" label-width="120px" inline>
            <el-form-item
              :label="$t('orderstatus')"
              style="display: block"
              class="is_Scroll"
            >
              <el-radio-group
                v-model="tableFrom.status"
                type="button"
                @change="getList(1)"
              >
                <el-radio-button label
                  >{{ $t("all") }}
                  {{
                    "(" + orderChartType.all ? orderChartType.all : 0 + ")"
                  }}</el-radio-button
                >
                <el-radio-button label="0"
                  >{{ $t("tobereviewed") }}
                  {{
                    "(" + orderChartType.audit ? orderChartType.audit : 0 + ")"
                  }}</el-radio-button
                >
                <el-radio-button label="-1"
                  >{{ $t("approvalfailed") }}
                  {{
                    "(" + orderChartType.refuse
                      ? orderChartType.refuse
                      : 0 + ")"
                  }}</el-radio-button
                >
                <el-radio-button label="1"
                  >{{ $t("approved") }}
                  {{
                    "(" + orderChartType.agree ? orderChartType.agree : 0 + ")"
                  }}</el-radio-button
                >
                <el-radio-button label="2"
                  >{{ $t("pendingreceipt") }}
                  {{
                    "(" + orderChartType.backgood
                      ? orderChartType.backgood
                      : 0 + ")"
                  }}</el-radio-button
                >
                <el-radio-button label="3"
                  >{{ $t("completed") }}
                  {{
                    "(" + orderChartType.end ? orderChartType.end : 0 + ")"
                  }}</el-radio-button
                >
              </el-radio-group>
            </el-form-item>
            <el-form-item
              :label="$t('timeselection')"
              class="width100 is_Scroll"
              style="display: block"
            >
              <el-radio-group
                v-model="tableFrom.date"
                type="button"
                class="mr20"
                size="small"
                @change="selectChange(tableFrom.date)"
              >
                <el-radio-button
                  v-for="(item, i) in fromList.fromTxt"
                  :key="i"
                  :label="item.val"
                  >{{ item.text }}</el-radio-button
                >
              </el-radio-group>
              <el-date-picker
                v-model="timeVal"
                value-format="yyyy/MM/dd"
                format="yyyy/MM/dd"
                size="small"
                type="daterange"
                placement="bottom-end"
                :placeholder="$t('customtime')"
                style="width: 250px"
                @change="onchangeTime"
              />
            </el-form-item>
            <el-form-item :label="$t('refundno')" class="width100">
              <el-input
                v-model="tableFrom.refund_order_sn"
                clearable
                :placeholder="$t('please44')"
                class="selWidth"
                size="small"
                @keyup.enter.native="getList(1)"
              >
                <el-button
                  slot="append"
                  icon="el-icon-search"
                  size="small"
                  class="el-button-solt"
                  @click="getList(1)"
                />
              </el-input>
            </el-form-item>
            <el-form-item :label="$t('refundtype')" class="width100">
              <el-select
                v-model="tableFrom.refund_type"
                :placeholder="$t('pleaseselect')"
                class="filter-item selWidth mr20"
                clearable
                @change="getList(1)"
              >
                <el-option
                  v-for="item in refundTypeList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                />
              </el-select>
            </el-form-item>
            <el-form-item :label="$t('orderno')" class="width100">
              <el-input
                v-model="tableFrom.order_sn"
                clearable
                :placeholder="$t('please44')"
                class="selWidth"
                size="small"
                @keyup.enter.native="getList(1)"
              >
                <el-button
                  slot="append"
                  icon="el-icon-search"
                  size="small"
                  class="el-button-solt"
                  @click="getList(1)"
                />
              </el-input>
            </el-form-item>
            <el-form-item :label="$t('returnexpressbillno')" class="width100">
              <el-input
                v-model="tableFrom.delivery_id"
                clearable
                :placeholder="$t('please45')"
                class="selWidth"
                size="small"
                @keyup.enter.native="getList(1)"
              >
                <el-button
                  slot="append"
                  icon="el-icon-search"
                  size="small"
                  class="el-button-solt"
                  @click="getList(1)"
                />
              </el-input>
              <el-button
                size="small"
                type="primary"
                @click.native="getExportFileList"
                >{{ $t("exportrefundform") }}</el-button
              >
            </el-form-item>
          </el-form>
        </div>
      </div>
      <div class="order_list_mobile" v-if="clientWidth < 1024">
        <div class="item" v-for="(item, index) in tableData.data" :key="index">
          <div class="item_top">
            <div class="orderno">
              {{ $t("refundno") }} :{{ item.refund_order_sn }}
              <span v-show="item.is_del > 0" style="color: #ed4014;">{{
                $t("userdeleted")
              }}</span>
            </div>
            <div class="ordertime">
              {{ $t("statuschangetime") }} :{{ item.status_time }}
            </div>
          </div>
          <div class="item_middle">
            <div class="info">
              <div v-for="(val, i) in item.refundProduct" :key="i">
                <div class="demo-image__preview">
                  <el-image
                    :src="val.product && val.product.cart_info.product.image"
                    :preview-src-list="[
                      val.product && val.product.cart_info.product.image
                    ]"
                  />
                  <span class="tabBox_tit">
                    {{
                      val.product &&
                        val.product.cart_info.product.store_name + " | "
                    }}{{ val.product && val.product.cart_info.productAttr.sku }}
                  </span>

                  <span
                    v-if="
                      item.order &&
                        item.order.activity_type === 2 &&
                        val.product &&
                        val.product.cart_info.productPresellAttr
                    "
                    class="tabBox_pice"
                  >
                    <div class="price">
                      {{
                        "$" + val.product &&
                          val.product.cart_info.productPresellAttr.presell_price
                      }}
                    </div>
                    <div class="num">{{ " x " + val.refund_num }}</div>
                  </span>
                  <span
                    v-else-if="
                      item.order &&
                        item.order.activity_type === 3 &&
                        val.product &&
                        val.product.cart_info.productAssistAttr.assist_price
                    "
                    class="tabBox_pice"
                  >
                    <div class="price">
                      {{
                        "$" + val.product &&
                          val.product.cart_info.productAssistAttr.assist_price
                      }}
                    </div>
                    <div class="num">{{ " x " + val.refund_num }}</div>
                  </span>
                  <span v-else class="tabBox_pice">
                    <div class="price">
                      {{
                        "$" + val.product &&
                          val.product.cart_info.productAttr.price
                      }}
                    </div>
                    <div class="num">{{ " x " + val.refund_num }}</div>
                  </span>
                </div>
              </div>
            </div>
            <div class="desc">
              <span style="display: block">{{
                item.status | orderRefundFilter
              }}</span>
              <span v-if="item.status == -1" style="display: block"
                >{{ $t("reasonforrejection") }}：{{ item.fail_message }}</span
              >
              <span style="display: block"
                >{{ $t("reasonforrefund") }}{{ item.refund_message }}</span
              >
            </div>
          </div>
          <div class="item_bottom">
            <el-button
              type="text"
              size="small"
              @click="onOrderDetail(item.order.order_sn)"
              >{{ $t("orderdetails") }}</el-button
            >
            <el-button
              type="text"
              size="small"
              @click="onRefundOrderDetail(item.refund_order_id)"
              >{{ $t("refundnotedetails") }}</el-button
            >
            <el-button
              v-if="item.status === 0"
              type="text"
              size="small"
              @click="onOrderStatus(item.refund_order_id)"
              >{{ $t("refund") }}</el-button
            >
            <!-- <el-button type="text" size="small" @click="onOrderLog(item.refund_order_id)">{{ $t('orderrecord') }}</el-button> -->
            <el-button
              type="text"
              size="small"
              @click="onOrderMark(item.refund_order_id)"
              >{{ $t("orderremarks") }}</el-button
            >
            <el-button
              v-if="item.status === 2"
              type="text"
              size="small"
              @click="confirmReceipt(item)"
              >{{ $t("confirmreceipt") }}</el-button
            >
          </div>
        </div>
      </div>

      <div class="order_list_pc" v-if="clientWidth > 1024">
        <el-table
          v-loading="listLoading"
          :data="tableData.data"
          style="width: 100%"
          size="mini"
          class="table"
          highlight-current-row
        >
          <el-table-column type="expand">
            <template slot-scope="props">
              <el-form
                label-position="left"
                inline
                class="demo-table-expand demo-table-expands"
              >
                <el-form-item :label="$t('ordernumber')">
                  <span>{{ props.row.order.order_sn }}</span>
                </el-form-item>
                <el-form-item :label="$t('totalpriceofrefundedgoods')">
                  <span v-if="props.row.order.activity === 2">{{
                    getPresellTotal(props.row.refundProduct)
                  }}</span>
                  <span v-else-if="props.row.order.activity === 3">{{
                    getAssistTotal(props.row.refundProduct)
                  }}</span>
                  <span v-else>{{ getTotal(props.row.refundProduct) }}</span>
                </el-form-item>
                <el-form-item :label="$t('totalrefunditems')">
                  <span>{{ props.row.refund_num }}</span>
                </el-form-item>
                <el-form-item :label="$t('refundapplicationtime')">
                  <span>{{ props.row.create_time | filterEmpty }}</span>
                </el-form-item>
                <el-form-item :label="$t('usernotes')">
                  <span>{{ props.row.mark | filterEmpty }}</span>
                </el-form-item>
                <el-form-item :label="$t('merchantremarks')">
                  <span>{{ props.row.mer_mark | filterEmpty }}</span>
                </el-form-item>
                <el-form-item
                  v-if="props.row.status === 2"
                  :label="$t('courierservices')"
                >
                  <span>{{ props.row.delivery_type | filterEmpty }}</span>
                </el-form-item>
                <el-form-item
                  v-if="props.row.status === 2"
                  :label="$t('couriernumber')"
                >
                  <span class="mr5">{{
                    props.row.delivery_id | filterEmpty
                  }}</span>
                  <el-button type="text" @click="openLogistics(props.row)">{{
                    $t("logisticsquery")
                  }}</el-button>
                </el-form-item>
              </el-form>
            </template>
          </el-table-column>
          <el-table-column :label="$t('refundno')" min-width="170">
            <template slot-scope="scope">
              <span style="display: block" v-text="scope.row.refund_order_sn" />
            </template>
          </el-table-column>
          <el-table-column
            prop="user.nickname"
            :label="$t('userinformation')"
            min-width="130"
          />
          <el-table-column
            prop="refund_price"
            :label="$t('refundamount')"
            min-width="130"
          />
          <el-table-column
            prop="nickname"
            :label="$t('productinformation')"
            min-width="330"
          >
            <template slot-scope="scope">
              <div
                v-for="(val, i) in scope.row.refundProduct"
                :key="i"
                class="tabBox acea-row row-middle"
              >
                <div class="demo-image__preview">
                  <el-image
                    :src="val.product && val.product.cart_info.product.image"
                    :preview-src-list="[
                      val.product && val.product.cart_info.product.image
                    ]"
                  />
                </div>
                <span class="tabBox_tit"
                  >{{
                    val.product &&
                      val.product.cart_info.product.store_name + " | "
                  }}{{ val.product && val.product.cart_info.productAttr.sku }}
                </span>
                <span
                  v-if="
                    scope.row.order &&
                      scope.row.order.activity_type === 2 &&
                      val.product &&
                      val.product.cart_info.productPresellAttr
                  "
                  class="tabBox_pice"
                  >{{
                    "$" + val.product &&
                      val.product.cart_info.productPresellAttr.presell_price +
                        " x " +
                        val.refund_num
                  }}</span
                >
                <span
                  v-else-if="
                    scope.row.order &&
                      scope.row.order.activity_type === 3 &&
                      val.product &&
                      val.product.cart_info.productAssistAttr.assist_price
                  "
                  class="tabBox_pice"
                  >{{
                    "$" + val.product &&
                      val.product.cart_info.productAssistAttr.assist_price +
                        " x " +
                        val.refund_num
                  }}</span
                >
                <span v-else class="tabBox_pice">{{
                  "$" + val.product &&
                    val.product.cart_info.productAttr.price +
                      " x " +
                      val.refund_num
                }}</span>
              </div>
            </template>
          </el-table-column>
          <el-table-column :label="$t('refundtype')" min-width="120">
            <template slot-scope="scope">
              <span>{{
                scope.row.refund_type == 1 ? $t("refund") : $t("returnrefund")
              }}</span>
            </template>
          </el-table-column>
          <el-table-column
            prop="order.real_name"
            :label="$t('returnedby')"
            min-width="160"
          />
          <el-table-column
            prop="delivery_id"
            :label="$t('returnexpressbillno')"
            min-width="160"
          />
          <el-table-column
            prop="serviceScore"
            :label="$t('orderstatus')"
            min-width="250"
          >
            <template slot-scope="scope">
              <span style="display: block">{{
                scope.row.status | orderRefundFilter
              }}</span>
              <span v-if="scope.row.status == -1" style="display: block"
                >{{ $t("reasonforrejection") }}：{{
                  scope.row.fail_message
                }}</span
              >
              <span style="display: block"
                >{{ $t("reasonforrefund") }}{{ scope.row.refund_message }}</span
              >
              <span style="display: block"
                >{{ $t("statuschangetime") }}：{{ scope.row.status_time }}</span
              >
            </template>
          </el-table-column>
          <el-table-column
            :label="$t('operation')"
            min-width="120"
            fixed="right"
            align="center"
          >
            <template slot-scope="scope">
              <el-button
                type="text"
                size="small"
                @click="onOrderDetail(scope.row.order.order_sn)"
                >{{ $t("orderdetails") }}</el-button
              >
              <el-button
                type="text"
                size="small"
                @click="onRefundOrderDetail(scope.row.refund_order_id)"
                >{{ $t("refundnotedetails") }}</el-button
              >
              <el-button
                v-if="scope.row.status === 0"
                type="text"
                size="small"
                @click="onOrderStatus(scope.row.refund_order_id)"
                >{{ $t("refund") }}</el-button
              >
              <!-- <el-button type="text" size="small" @click="onOrderLog(scope.row.refund_order_id)">{{ $t('orderrecord') }}</el-button> -->
              <el-button
                type="text"
                size="small"
                @click="onOrderMark(scope.row.refund_order_id)"
                >{{ $t("orderremarks") }}</el-button
              >
              <el-button
                v-if="scope.row.status === 2"
                type="text"
                size="small"
                @click="confirmReceipt(scope.row)"
                >{{ $t("confirmreceipt") }}</el-button
              >
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div class="block">
        <el-pagination
          :page-sizes="[20, 40, 60, 80]"
          :page-size="tableFrom.limit"
          :current-page="tableFrom.page"
          layout="total, sizes, prev, pager, next, jumper"
          :total="tableData.total"
          @size-change="handleSizeChange"
          @current-change="pageChange"
        />
      </div>
    </el-card>
    <!--记录-->
    <el-dialog
      :title="$t('operationrecord')"
      :visible.sync="dialogVisible"
      width="700px"
    >
      <el-table
        v-loading="LogLoading"
        border
        :data="tableDataLog.data"
        style="width: 100%"
      >
        <el-table-column
          prop="refund_order_id"
          align="center"
          :label="$t('refundslipid')"
          min-width="80"
        />
        <el-table-column
          prop="change_message"
          :label="$t('operationrecord')"
          align="center"
          min-width="280"
        />
        <el-table-column
          prop="change_time"
          :label="$t('operationtime')"
          align="center"
          min-width="280"
        />
      </el-table>
      <div class="block">
        <el-pagination
          :page-sizes="[20, 40, 60, 80]"
          :page-size="tableFromLog.limit"
          :current-page="tableFromLog.page"
          layout="total, sizes, prev, pager, next, jumper"
          :total="tableDataLog.total"
          @size-change="handleSizeChangeLog"
          @current-change="pageChangeLog"
        />
      </div>
    </el-dialog>
    <!--详情-->
    <details-from
      ref="orderDetail"
      :order-datalist="orderDatalist"
      @get-logistics="openLogistics"
    />
    <el-dialog
      v-if="dialogLogistics"
      :title="$t('logisticsquery')"
      :visible.sync="dialogLogistics"
      width="350px"
      :before-close="handleClose"
    >
      <logistics-from
        v-if="orderDetails"
        :order-datalist="orderDetails"
        :result="result"
        :logistics-name="logisticsName"
      />
    </el-dialog>
  </div>
</template>

<script>
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import {
  refundorderStatusApi,
  refundorderListApi,
  orderUpdateApi,
  orderDeliveryApi,
  refundorderLogApi,
  refundorderDeleteApi,
  refundorderMarkApi,
  refundorderDetailApi,
  refundorderExpressApi,
  confirmReceiptApi,
  refundListImportApi
} from "@/api/order";
import detailsFrom from "./refundDetail";
import logisticsFrom from "../logistics";
import { roterPre } from "@/settings";
export default {
  name: "OrderRefund",
  components: { detailsFrom, logisticsFrom },
  data() {
    return {
      logisticsName: "refund",
      dialogLogistics: false,
      orderId: 0,
      tableData: {
        data: [],
        total: 0
      },
      refundTypeList: [
        { value: 1, label: this.$t("refund") },
        { value: 2, label: "退款退货" }
      ],
      clientWidth: "1200",
      listLoading: true,
      roterPre: roterPre,
      tableFrom: {
        delivery_id: "",
        refund_type: "",
        status: "",
        date: "",
        page: 1,
        limit: 20,
        order_sn: "",
        id: this.$route.query.id ? this.$route.query.id : ""
      },
      orderChartType: {},
      timeVal: [],
      fromList: {
        title: this.$t("selectionperiod"),
        custom: true,
        fromTxt: [
          { text: this.$t("all"), val: "" },
          { text: this.$t("today"), val: "today" },
          { text: this.$t("yesterday"), val: "yesterday" },
          { text: this.$t("last7days"), val: "lately7" },
          { text: this.$t("last30days"), val: "lately30" },
          { text: this.$t("thismonth"), val: "month" },
          { text: this.$t("thisyear"), val: "year" }
        ]
      },
      selectionList: [],
      tableFromLog: {
        page: 1,
        limit: 10
      },
      tableDataLog: {
        data: [],
        total: 0
      },
      LogLoading: false,
      dialogVisible: false,
      orderDatalist: null,
      orderDetails: {},
      result: []
    };
  },
  mounted() {
    if (this.$route.query.hasOwnProperty("sn")) {
      this.tableFrom.order_sn = this.$route.query.sn;
    } else {
      this.tableFrom.order_sn = "";
    }
    this.clientWidth = document.body.clientWidth;
    this.getList(1);
  },
  // 被缓存接收参数
  activated() {
    if (this.$route.query.hasOwnProperty("sn")) {
      this.tableFrom.order_sn = this.$route.query.sn;
    } else {
      this.tableFrom.order_sn = "";
    }
    this.getList(1);
  },
  methods: {
    // 订单详情
    onOrderDetail(order_sn) {
      this.$router.push({
        name: "OrderList",
        query: {
          order_sn: order_sn
        }
      });
    },
    // 退款
    onOrderStatus(id) {
      this.$modalForm(refundorderStatusApi(id)).then(() => this.getList(""));
    },
    // 确认收货
    confirmReceipt(row) {
      const that = this;
      const h = this.$createElement;
      this.$msgbox({
        title: "是否确认收货？",
        message: h("div", null, [
          h("p", null, "退货物流：" + row.delivery_type),
          h("p", null, "退货快递：" + row.delivery_id)
        ]),
        showCancelButton: true,
        confirmButtonText: this.$t("confirm"),
        cancelButtonText: this.$t("cancel"),
        beforeClose: (action, instance, done) => {
          if (action === "confirm") {
            confirmReceiptApi(row.refund_order_id)
              .then(res => {
                that.$message.success(res.message);
                done();
                that.getList("");
              })
              .catch(({ res }) => {
                that.$message.error(res.message);
              });
          } else {
            done();
          }
        }
      })
        .then(action => {})
        .catch(e => e); // 注意这里，这里是重点！！！;
    },
    getExportFileList() {
      refundListImportApi()
        .then(res => {
          const h = this.$createElement;
          this.$msgbox({
            title: this.$t("tips"),
            message: h("p", null, [
              h("span", null, this.$t("please71")),
              h("span", { style: "color: teal" }, this.$t("exportrecords")),
              h("span", null, this.$t("see"))
            ]),
            confirmButtonText: this.$t("igotit")
          }).then(action => {
            this.$router.push({ path: this.roterPre + "/export/list" });
          });
        })
        .catch(res => {
          this.$message.error(res.message);
        });
    },
    getTotal(row) {
      let sum = 0;
      for (let i = 0; i < row.length; i++) {
        sum += row[i].product
          ? row[i].product.cart_info.productAttr.price * row[i].refund_num
          : "";
      }
      return sum;
    },
    // 预售商品退款金额
    getPresellTotal(row) {
      let sum = 0;
      for (let i = 0; i < row.length; i++) {
        sum += row[i].product
          ? row[i].product.cart_info.productPresellAttr.presell_price *
            row[i].refund_num
          : "";
      }
      return sum;
    },
    // 助力商品退款金额
    getAssistTotal(row) {
      let sum = 0;
      for (let i = 0; i < row.length; i++) {
        sum += row[i].product
          ? row[i].product.cart_info.productAssistAttr.assist_price *
            row[i].refund_num
          : "";
      }
      return sum;
    },
    // 详情
    onRefundOrderDetail(id) {
      this.orderId = id;
      this.$refs.orderDetail.dialogVisible = true;
      this.loading = true;
      refundorderDetailApi(id)
        .then(res => {
          this.orderDatalist = res.data;
          this.loading = false;
          this.$refs.orderDetail.onOrderLog(id);
        })
        .catch(({ message }) => {
          this.loading = false;
          this.$message.error(message);
        });
    },
    // 订单记录
    onOrderLog(id) {
      this.dialogVisible = true;
      this.LogLoading = true;
      refundorderLogApi(id, this.tableFromLog)
        .then(res => {
          this.tableDataLog.data = res.data.list;
          this.tableDataLog.total = res.data.count;
          this.LogLoading = false;
        })
        .catch(res => {
          this.$message.error(res.message);
          this.LogLoading = false;
        });
    },
    pageChangeLog(page) {
      this.tableFromLog.page = page;
      this.getList("");
    },
    handleSizeChangeLog(val) {
      this.tableFromLog.limit = val;
      this.getList("");
    },
    // 订单删除
    handleDelete(row, idx) {
      if (row.is_del === 1) {
        this.$modalSure().then(() => {
          refundorderDeleteApi(row.refund_order_id)
            .then(({ message }) => {
              this.$message.success(message);
              this.tableData.data.splice(idx, 1);
            })
            .catch(({ message }) => {
              this.$message.error(message);
            });
        });
      } else {
        this.$confirm(
          "您选择的的订单存在用户未删除的订单，无法删除用户未删除的订单！",
          this.$t("tips"),
          {
            confirmButtonText: this.$t("confirm"),
            type: "error"
          }
        );
      }
    },
    // 备注
    onOrderMark(id) {
      this.$modalForm(refundorderMarkApi(id)).then(() => this.getList(""));
    },
    // 选择时间
    selectChange(tab) {
      this.tableFrom.date = tab;
      this.timeVal = [];
      this.getList(1);
    },
    // 具体日期
    onchangeTime(e) {
      this.timeVal = e;
      this.tableFrom.date = e ? this.timeVal.join("-") : "";
      this.getList(1);
    },
    // 编辑
    edit(id) {
      this.$modalForm(orderUpdateApi(id)).then(() => this.getList(""));
    },
    // 发货
    send(id) {
      this.$modalForm(orderDeliveryApi(id)).then(() => this.getList(""));
    },
    // 列表
    getList(num) {
      this.listLoading = true;
      this.tableFrom.page = num || this.tableFrom.page;
      refundorderListApi(this.tableFrom)
        .then(res => {
          this.orderChartType = res.data.stat;
          this.tableData.data = res.data.list;
          this.tableData.total = res.data.count;
          this.listLoading = false;
        })
        .catch(res => {
          this.$message.error(res.message);
          this.listLoading = false;
        });
    },
    pageChange(page) {
      this.tableFrom.page = page;
      this.getList();
    },
    handleSizeChange(val) {
      this.tableFrom.limit = val;
      this.getList();
    },
    openLogistics(row) {
      this.orderDetails = row;
      this.getOrderData(row.refund_order_id);
      this.dialogLogistics = true;
    },
    handleClose() {
      this.dialogLogistics = false;
      this.dialogConfirm = false;
    },
    // 获取订单物流信息
    getOrderData(id) {
      refundorderExpressApi(id)
        .then(async res => {
          this.result = res.data;
        })
        .catch(res => {
          this.$message.error(res.message);
        });
    }
  }
};
</script>

<style lang="scss" scoped>
.demo-table-expands {
  ::v-deep label {
    width: 110px !important;
    color: #99a9bf;
  }
}

.selWidth {
  width: 300px;
}

.el-dropdown-link {
  cursor: pointer;
  color: #409eff;
  font-size: 12px;
}

.el-icon-arrow-down {
  font-size: 12px;
}

.tabBox_tit {
  width: 60%;
  font-size: 12px !important;
  margin: 0 2px 0 10px;
  letter-spacing: 1px;
  padding: 5px 0;
  box-sizing: border-box;
}
</style>
